#!/bin/sh

tar xfz pthreads-win32.tar.gz || exit 1
cd pthreads

patch -p1 < ../pthreads-w64sup.patch || exit 1
cp -p config.h pthreads_win32_config.h || exit 1
cp -p pthread.h pthread.h.bak || exit 1
sed -e 's/HAVE_CONFIG_H/1/' \
    -e 's/config.h/pthreads_win32_config.h/' \
    < pthread.h.bak >pthread.h || exit 1
cp -p GNUmakefile GNUmakefile.bak || exit 1

cd ..

